package de.tum.in.eist.poll.service;


import java.util.List;

import com.google.gwt.user.client.rpc.AsyncCallback;

import de.tum.in.eist.poll.shared.beans.Lecture;
import de.tum.in.eist.poll.shared.beans.Feedback;
import de.tum.in.eist.poll.shared.beans.Notification;
import de.tum.in.eist.poll.shared.beans.Question;
import de.tum.in.eist.poll.shared.beans.Student;
import de.tum.in.eist.poll.shared.beans.User;


/**
 * The async counterpart of {@link PollService}.
 */
public interface PollServiceAsync {
	
	/**
	 * The async counterpart of {@link PollService#login(String, String)}.
	 */
	void login(String name, String password, AsyncCallback<User> callback);
	
	/**
	 * The async counterpart of {@link PollService#newStudents(String, String, Integer)}.
	 */
	void newStudents(String lecturerID, String Prefix, Integer amount, AsyncCallback<List<Student>> users);
	
	/**
	 * The async counterpart of {@link PollService#removeUsers(String[])}.
	 */
	void removeUsers(String[] userIDs, AsyncCallback<String> callback);
	
	/**
	 * The async counterpart of {@link PollService#requestStudents(String)}.
	 * @param lecturer
	 */
	void requestStudents(String lecturerID, AsyncCallback<List<Student>> callback)
			throws IllegalArgumentException;
	
	/**
	 * The async counterpart of {@link PollService#addLecture(Lecture)}.
	 */
	void addLecture(Lecture lecture, AsyncCallback<String> callback);
	
	/**
	 * The async counterpart of {@link PollService#requestLectures(String)}.
	 */
	void requestLectures(String userID, AsyncCallback<List<Lecture>> callback);
	
	/**
	 * The async counterpart of {@link PollService#closePoll(String)}.
	 */
	void closePoll(String lectureID, AsyncCallback<String> callback);
	
	/**
	 * The async counterpart of {@link PollService#requestFeedback(String)}.
	 */
	void requestFeedback(String lectureID, AsyncCallback<List<Feedback>> callback);
	
	/**
	 * The async counterpart of {@link PollService#submitFeedback(Feedback)}.
	 */
	void submitFeedback(Feedback feedback, AsyncCallback<String> callback);
	
	/**
	 * The async counterpart of {@link PollService#getQuestions(String)}.
	 */
	void getQuestions(String lectureID, AsyncCallback<Question[]> callback);
	
	/**
	 * The async counterpart of {@link PollService#sendNotification(String[], AsyncCallback<Boolean>)}.
	 */
	void sendNotification(String[] userIDs, Notification notification, AsyncCallback<Boolean> callback);
	
	/**
	 * The async counterpart of {@link PollService#sendNotificationToStudents(String, AsyncCallback<Boolean>)}.
	 */
	void sendNotificationToStudents(String lecturerID, Notification notification, AsyncCallback<Boolean> callback);
	
	/**
	 * The async counterpart of {@link PollService#receiveNotification(String, AsyncCallback<Boolean>)}.
	 */
	void receiveNotification(String userID,  AsyncCallback<List<Notification>> callback);

	/**
	 * @param userID
	 * @param currentLectureId
	 * @param asyncCallback
	 */
	void hasSubmitted(String userId, String lectureId, AsyncCallback<Boolean> asyncCallback);
}
